home *** CD-ROM | disk | FTP | other *** search
/ Loadstar 15 / 015.d81 / force i (.txt) < prev    next >
Commodore BASIC  |  2022-08-26  |  9KB  |  296 lines

  1. 1 rem force i                                       gary v. fields  sept. 1984
  2. 2 printchr$(147)chr$(5):poke53281,2:poke53280,2:goto35000
  3. 3 poke53281,0:poke53280,0:ifx>1then35032
  4. 4 v1=54296:h1=54273:l1=54272:a1=54277:s1=54278:w1=54276:cc=54272:sq=1
  5. 5 h2=54280:l2=54279:a2=54284:s2=54285:w2=54283:fs=700:dr=5:am=10:ge=5
  6. 10 ch$=chr$(147):h$=chr$(19):sc=12
  7. 22 gosub50:gosub35032
  8. 23 print"":gosub30000:poke1944+cc,2:goto1000
  9. 24 pokew1,0:pokev1,15:pokeh1,255:pokel1,0:pokea1,180:pokes1,240:pokew1,33:return
  10. 25 pokew1,0:pokev1,15:pokeh1,0:pokel1,200:pokea1,140:pokes1,0:pokew1,33:return
  11. 27 pokew1,0:pokeh1,12:pokel1,120:pokea1,8:pokes1,0:pokew1,129:return
  12. 28 pokew1,130:pokeh1,2:pokel1,120:pokew1,129:return
  13. 29 pokew1,130:pokeh1,2:pokel1,2:pokea1,60:pokes1,0:pokew1,129:return
  14. 30 tf=1:rp=peek(ep):ifrp<33orrp>46thentf=0
  15. 31 forb=1totc:ifep=et(b)thenet(b)=1944:poke1944,34:ed=ed+1:re=re-1
  16. 32 next:ifep=mtthendr=dr-1:gosub150
  17. 33 gosub25:ford1=0to50:next:gosub27:pokeep,60:pokeec,5:ford1=0to15:next
  18. 34 gosub28:pokeep,62:pokeec,7:ford1=0to70:next
  19. 35 gosub29:ford1=0to250:next:pokeep,63:pokeec,8:ford1=0to250:next
  20. 36 pokeep,32:pokeec,0
  21. 37 ifrp=46thentf=0:rp=0:goto34
  22. 38 iftf=1andrp<37thenpokeep,62:pokeec,11:goto1100
  23. 39 pokeep,32:pokeec,0:return
  24. 40 ford1=54272to54296:poked1,0:nextd1:return
  25. 45 l%=int(rnd(0)*3)+2:return
  26. 50 gosub40:pokev1,2:pokeh1,0:pokel1,240:pokea1,0:pokes1,240:pokew1,33:return
  27. 52 pokev1,6:pokeh1,1:ford1=0to200:next:fs=fs-5:return
  28. 55 iffs<1thenfs=0:y=6:gosub1530:gosub1530:gosub1530
  29. 56 return
  30. 60 pokeet(e),32:pokeet(e)+cc,0:return
  31. 100 ifdx<1thendx=1:return
  32. 102 ifdy<1thendy=1:return
  33. 104 ifdx>38thendx=38:return
  34. 105 ifdy>16thendy=16:return
  35. 106 ifmt-ud<1104then130
  36. 107 ifmt+ud>1783then130
  37. 108 pokemt,32:pokemt+cc,0:mt=mt+ud
  38. 109 ifpeek(mt)=32then130
  39. 110 ifmt=obthenreturn
  40. 112 ifpeek(mt)=46thenep=mt:ec=mt+cc:gosub30:y=6:goto130
  41. 116 ifpeek(mt)=38thenfs=fs-6:gosub40:gosub52:y=y+2:goto130
  42. 118 ifpeek(mt)=42thenfs=1000:am=30:goto130
  43. 120 ifpeek(mt)<>32thenmt=mt-ud
  44. 122 ifts=36thendx=dx+1
  45. 123 ifts=33thendy=dy-1
  46. 124 ifts=34thendx=dx-1
  47. 125 ifts=35thendy=dy+1
  48. 130 pokemt,ts:pokemt+cc,6:return
  49. 140 ifsc<1thenreturn
  50. 141 x=0:nd=int(rnd(0)*400)+1144
  51. 142 nd=nd+1:x=x+1:ifpeek(nd)>32andpeek(nd)<37thenpokend+cc,2
  52. 143 ifpeek(nd)=46thenpokend+cc,2
  53. 144 ifx>39thenfs=fs-70:sc=sc-1:y=y+1:return
  54. 145 j=1:ifsc>9thenj=0
  55. 146 printh$tab(25)"scouts@"spc(j)sc:goto142
  56. 150 j=1:ifsc>9thenj=0
  57. 151 printh$" reports @";tab(14)chr$(18)"[151]force[160]i[146]";tab(25)"scouts@"spc(j)sc
  58. 152 as=0:ifam<10thenas=1
  59. 153 printh$:ford1=0to17:print:next:iffs<1thenfs=0
  60. 154 print"[153]gun elev@";ge;tab(14)"ammo [154]'@"spc(as)am;
  61. 155 printtab(26)"[149]fuel@        ":printchr$(145)tab(33)fs:ifdr<1thendr=0:y=6
  62. 156 print"[154]! damage@"dr;:printtab(20)"sq/mile@"sq:printtab(1)"  count@"ed;
  63. 157 printtab(20)"[f7]@scouts "
  64. 158 print"  return@ pass"tab(20)"[f8]@restart";
  65. 161 return
  66. 200 ifpeek(mt)=33thenep=mt-(ge*40):t%=33
  67. 202 ifpeek(mt)=34thenep=mt+ge:t%=34:goto223
  68. 204 ifpeek(mt)=35thenep=mt+(ge*40):t%=35
  69. 206 ifpeek(mt)=36thenep=mt-ge:t%=36:goto223
  70. 209 ifge>3thenl%=int(rnd(0)*2)+1:ep=ep+l%-2:goto220
  71. 210 ifge=3thenl%=int(rnd(0)*2):ep=ep+l%:goto220
  72. 220 ec=ep+cc:gosub30:return
  73. 223 ifge<3then220
  74. 224 ifge=3thenl%=int(rnd(0)*2)+2
  75. 225 ifge>3thengosub45
  76. 227 ifge>6thenl%=int(rnd(0)*5)+1
  77. 230 onl%goto231,232,233,234,235
  78. 231 ep=ep+80:goto220
  79. 232 ep=ep+40:goto220
  80. 233 ep=ep:goto220
  81. 234 ep=ep-40:goto220
  82. 235 ep=ep-80:goto220
  83. 300 gosub52:y=y+1:ifpeek(mt)<>36thenpokemt,36:fs=fs-6:ts=36:return
  84. 302 ud=-1:dx=dx-1:goto100
  85. 400 gosub52:y=y+1:ifpeek(mt)<>33thenpokemt,33:fs=fs-2:ts=33:return
  86. 402 ud=-40:dy=dy+1:goto100
  87. 500 gosub52:y=y+1:ifpeek(mt)<>34thenpokemt,34:fs=fs-6:ts=34:return
  88. 502 ud=1:dx=dx+1:goto100
  89. 600 gosub52:y=y+1:ifpeek(mt)<>35thenpokemt,35:fs=fs-2:ts=35:return
  90. 602 ud=40:dy=dy-1:goto100
  91. 610 forx=0todsteps
  92. 611 if(et(e)+x-mf)=mtthengosub45:ep=mt:gosub230:gosub650:x=d
  93. 612 if(et(e)+x-mf)=dp+1thenep=dp+1:ec=dp+1+cc:gosub30:gosub650:gosub30:x=d
  94. 619 next:return
  95. 650 ford1=0to100:next:return
  96. 700 ife>axthene=0:return
  97. 702 ifre<1thenreturn
  98. 704 pt=0:ifabs(mt-et(e))<160thenpt=2
  99. 705 ifet(e)>1783thenreturn
  100. 706 ifet(e)<1104thenreturn
  101. 707 ifet(e)>1600thengosub45:ep=dp+1:gosub230
  102. 708 ifdy>11thenifre>2thengosub45:ep=ob:gosub230
  103. 709 ifdr<1thenreturn
  104. 710 ifnd>15thend=520:s=40:mf=120:pokeet(e),ch:gosub610
  105. 714 ifnd>20thend=12:s=1:mf=12:pokeet(e),36:gosub610:ifl%>3thengosub610
  106. 715 ifnd>40thend=12:s=1:mf=0:pokeet(e),34:gosub610:ifl%>4thengosub610
  107. 716 ifnd<15thend=240:s=-80:mf=120:pokeet(e),ch:gosub610:ifl%>3thengosub610
  108. 717 ifdr<1thenreturn
  109. 720 ifabs(et(e)-mt)=1thenep=mt:ec=mt+cc:gosub30
  110. 722 ifabs(et(e)-mt)=40thenep=mt:ec=mt+cc:gosub30
  111. 725 ifet(e)+40>1702anddy<3thengosub45:ep=dp+1:gosub230:goto735
  112. 730 ifmt-et(e)>20thench=35:wa%=40:goto740
  113. 732 ifmt-et(e)<-20thench=33:wa%=-40:goto740
  114. 733 ifet(e)<mtthenifet(e)-mt<dxthench=34:wa%=1:goto740
  115. 734 ifet(e)>mtthenifet(e)-mt<39thench=36:wa%=-1:goto740
  116. 735 wa%=0:ch=35:return
  117. 740 ey=peek(et(e)+wa%):ifey<>32thengosub900
  118. 800 pokeet(e),32:et(e)=et(e)+wa%:pokeet(e),ch:pokeet(e)+cc,pt:return
  119. 900 ifey=38thenreturn
  120. 902 ifey=46thengoto995
  121. 904 ifey>36theney=int(rnd(0)*20):ifey>15thengoto995
  122. 906 ey=int(rnd(0)*4)+1
  123. 908 ifey=1then735
  124. 910 ifey=2thenifpeek(et(e)+1)=32thenwa%=1:ch=34:return
  125. 912 ifey=3thenifpeek(et(e)-1)=32thenwa%=-1:ch=36:return
  126. 914 ifey>3thenifpeek(et(e)-40)=32thenwa%=-40:ch=33:return
  127. 990 goto735
  128. 995 ep=et(e)+wa%:ec=ep+cc:gosub30:return
  129. 1000 fs=fs-1:gosub50:gosub150:ifdr<1then4050
  130. 1001 gosub1200:gosub2500:y=0:poke198,0
  131. 1002 printh$"[154] move cmd@":gosub55
  132. 1003 gosub1200:iffs>0thenonjvgosub400,600,1525,300,1525,1525,1525,500
  133. 1004 gosub40:gosub50:getq$:ifq$=chr$(140)then4050
  134. 1005 gosub1140:ifmt=obandoc=1then5000
  135. 1006 ifq$=chr$(160)thengosub4060
  136. 1007 ifq$=chr$(136)thengosub140
  137. 1008 ifq$=chr$(13)theny=6
  138. 1009 iffs<1andam<1thengosub152:goto4050
  139. 1010 gosub152:ify<6then1002
  140. 1011 poke198,0:fl=4:gosub2501:printh$chr$(18)"enemy move"
  141. 1012 nd=int(rnd(0)*150)+1:ifnd>100andpeek(dp+1)=32thenpokedp+1,42:pokedp+cc+1,6
  142. 1013 ifnd<50thenpokeob,44:pokeob+cc,2
  143. 1014 gosub2000:ifdr<1then4050
  144. 1015 ifdy>14andre>2thengosub1500
  145. 1017 ifre<2then1028
  146. 1018 ifnd>80thenifdr>1thengosub1500
  147. 1028 oc=0:ifpeek(ob)=44thenoc=1
  148. 1029 ifq$=chr$(13)thengosub45:ifl%=3thengosub1530
  149. 1030 goto1000
  150. 1100 iftf=1thenifep=mtthenifdr>0thentf=int(rnd(0)*4)+1:pokemt,tf+32:tf=0
  151. 1140 ifq$="e"thengosub400
  152. 1141 ifq$="x"thengosub600
  153. 1142 ifq$="d"thengosub500
  154. 1143 ifq$="s"thengosub300
  155. 1144 ifdy>13thenifre>2thenifdr>0thenl%=int(rnd(0)*2)+2:ep=mt:gosub230
  156. 1145 ifdr<1theny=6
  157. 1146 gosub50:return
  158. 1200 jv=peek(56320):fr=jvand16:jv=15-(jvand15):return
  159. 1500 ifdy>12andre>1then1530
  160. 1508 ifdy>8andre>2then1530
  161. 1510 ifdy>6andre>3then1530
  162. 1515 ifdy>3andre>4then1530
  163. 1520 ey=int(rnd(0)*20):ifey>18then1530
  164. 1525 return
  165. 1530 printh$"incoming@'":x=int(rnd(0)*6)-3:ep=mt+x:ec=ep+cc
  166. 1532 gosub24:ford1=0to500:next:gosub40:gosub30
  167. 1540 return
  168. 2000 fore=0toax:ifet(e)=1944then2004
  169. 2002 gosub700:ifdr<1thene=ax
  170. 2004 nexte:return
  171. 2500 poke198,0:fl=am
  172. 2501 ifdr<1thenreturn
  173. 2502 fory=0tofl:printh$chr$(18)" gun cmd @":getq$
  174. 2503 ifq$=chr$(13)theny=fl:goto2620
  175. 2504 ifq$=chr$(134)thenge=ge+1:ifge>8thenge=9
  176. 2505 ifq$=chr$(160)thengosub4060
  177. 2506 ifq$=chr$(135)thenge=ge-1:ifge<2thenge=1
  178. 2507 ifq$=chr$(140)then4050
  179. 2508 ifmt<1265andpeek(mt)=33andge>3thenge=3
  180. 2510 ifdx<9thenifpeek(mt)=36thenifge>dxthenge=dx
  181. 2512 ifdx>31thenifpeek(mt)=34thenifge>39-dxthenge=39-dx
  182. 2514 ifdy<5thenifpeek(mt)=35thenifge>5thenge=5
  183. 2600 printh$"[150] fire cmd@"
  184. 2604 gosub1200
  185. 2605 ifam<1thenam=0:goto2620
  186. 2610 ifq$=chr$(133)thenfr=0
  187. 2612 iffr=0thenam=am-1:gosub200:fs=fs-2
  188. 2620 fs=fs-1:gosub152:nexty:return
  189. 4050 poke198,0:printh$:print:print:print:print"try again [y/n]"
  190. 4052 getq$:ifq$=""then4052
  191. 4054 ifq$="y"thenprintch$:clr:x=1:goto3
  192. 4056 ifq$<>"n"then4052
  193. 4058 gosub40:sys64738
  194. 4060 poke198,0:printh$"[158]  pause   "
  195. 4062 getq$:ifq$=""then4060
  196. 4063 printh$"          ":return
  197. 5000 gosub40:ifsq>5then5008
  198. 5002 sq=sq+1:dr=dr+1:sc=12:zx=0::fs=1000:am=am+15:ifam>24thenam=24
  199. 5004 goto23
  200. 5008 printchr$(147)"the battle is won"
  201. 5010 ed=ed*2:forx=1toed:l%=int(rnd(0)*4)+1:poke1104+x,l%+32:poke1104+x+cc,2
  202. 5011 x=x+1:forsq=0to50:nextsq:next
  203. 5012 poke1964,33:poke1964+cc,6
  204. 5014 forx=1toed:ep=1104+x:ec=ep+cc:gosub24:ford1=0to100:nextd1:gosub30
  205. 5016 p